import dva from 'dva';
import './index.css';
import createLoading from 'dva-loading';
import { browserHistory } from 'dva/router'

// 1. Initialize
const app = dva({
//配置加载动画
...createLoading({
    effects: true,
  }),
  history: browserHistory,//修改hashHistory为browserHistory
    onError (error) {  //处理全局错误
      console.log(
        `%cGlobal Error：${error.message}`,
        'color: red; background: rgb(221, 221, 221); font-size: 17px;'
      );
    },
  });

// 2. Plugins
// app.use({});

// 3. Model
app.model(require('./models/app'));
app.model(require('./models/data'));

// 4. Router
app.router(require('./router'));

// 5. Start
app.start('#root');
